--- title: dashboards keywords: fastai sidebar: home_sidebar summary: "Supplies dashboards to investigate datasets and training results. Dashboards are defined as classes, to show the dashboard use the .show() function on an dashboard instance." description: "Supplies dashboards to investigate datasets and training results. Dashboards are defined as classes, to show the dashboard use the .show() function on an dashboard instance." nb_path: "nbs/dashboards.ipynb" ---
{% raw %}
{% endraw %} {% raw %}
{% endraw %} {% raw %}
pn.extension()
{% endraw %}

Test data setup

{% raw %}
import icedata
{% endraw %} {% raw %}
test_data_dir = icedata.fridge.load_data()
test_class_map = icedata.fridge.class_map()
test_parser = icedata.fridge.parser(test_data_dir, test_class_map)
test_train_records, test_valid_records = test_parser.parse()
INFO     - Autofixing records | icevision.parsers.parser:parse:126

{% endraw %}

Dataset overview

{% raw %}

class DatasetOverview[source]

DatasetOverview(records=None, data=None, class_map=None, height=500, width=1500)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
dso = DatasetOverview(test_valid_records, class_map=test_class_map, height=500)
dso.show()
{% endraw %} {% raw %}
dso = DatasetOverview(data=aggregate_record_data(test_valid_records, test_class_map), class_map=test_class_map, height=700, width=500)
dso.show()
{% endraw %} {% raw %}

class MultiDatasetOverview[source]

MultiDatasetOverview(datasets, height=500, width=1500)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
test_dataset = aggregate_record_data(test_valid_records, test_class_map)
mdo = MultiDatasetOverview([test_dataset.iloc[:10], test_dataset.iloc[:50], test_dataset.iloc[:60], test_dataset], width=500, height=500)
mdo.show()
{% endraw %} {% raw %}
mdo_empty = MultiDatasetOverview([])
assert mdo_empty.show() is None
{% endraw %}

Dataset filter

{% raw %}

class DatasetFilter[source]

DatasetFilter(records, class_map=None, export_variable:Optional[list]=None, height=500, width=500)

Creates a gallery with filter options to select subsets of the data. If the export_varialbe is set to a variable, that is a list a dict with the current selection (pd.Dataframe (key: data) and list of records (key: records)) will be append to the list.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
dump_var = []
ds_filter = DatasetFilter(test_valid_records, test_class_map, export_variable=dump_var, width=700, height=500).show()
# trigger click event to test if record is added to dump_var
ds_filter[-1].clicks += 1
assert len(dump_var) == 1
assert len(dump_var[0]["records"]) == len(test_valid_records)
ds_filter
{% endraw %}

Dataset creator

{% raw %}

class ObservableList[source]

ObservableList(observable_list)

{% endraw %} {% raw %}
{% endraw %} {% raw %}

class DatasetFilterThatOnlyExportsStats[source]

DatasetFilterThatOnlyExportsStats(records, class_map=None, export_variable:Optional[list]=None, height=500, width=500) :: DatasetFilter

Creates a gallery with filter options to select subsets of the data. If the export_varialbe is set to a variable, that is a list a dict with the current selection (pd.Dataframe (key: data) and list of records (key: records)) will be append to the list.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
dump_var = []
dstoes_filter = DatasetFilterThatOnlyExportsStats(test_valid_records, test_class_map, export_variable=dump_var).show()
# trigger click event to test if record is added to dump_var
dstoes_filter[-1].clicks += 1
assert len(dump_var) == 1
assert isinstance(dump_var[0], pd.DataFrame)
dstoes_filter
{% endraw %} {% raw %}

class DatasetCreator[source]

DatasetCreator(records, class_map=None, height=500, width=1000)

{% endraw %} {% raw %}
{% endraw %} {% raw %}
dsc = DatasetCreator(test_valid_records, test_class_map)
dsc.show()
{% endraw %}

Dahboard for comparing train and val dataset

{% raw %}

class TrainValRecordsComparison[source]

TrainValRecordsComparison(train_records, val_records, class_map=None)

Dashboard to compare the generated train and val records, to ensure the don't diverge to much from each other.

{% endraw %} {% raw %}
{% endraw %} {% raw %}
tvr_comp = TrainValRecordsComparison(test_train_records, test_valid_records, test_class_map)
tvr_comp.show()
{% endraw %}